#pragma once
#include "Stdafx.h"
#include "Scene.h"

namespace Pulpy
{
	class SceneManager
	{
	private:
		static Scene * _CurrentScene;
		static Scene * _PreviousScene;
		static Scene * _OverlayScene;
		SceneManager() { }
		static std::map<std::string, Scene *> _SceneList;
	public:
		static SceneManager getInstance()
		{
			static SceneManager s_instance;
			return s_instance;
		}
		void addScene(std::string name, Scene * s)
		{
			if(_SceneList[name] == NULL)
				_SceneList[name] = s;
		}
		Scene * getCurrentScene() { return _CurrentScene; }
		Scene * getPreviousScene() { return _PreviousScene; }
		Scene * getOverlayScene() { return _OverlayScene; }
		void drawScenes();
		void updateScenes();
		void handleKeyboard(int key, int x, int y);
		void handleKeyboardUp(int key, int x, int y);
		void handleKeyboardSpecial(int key, int x, int y);
		void handleMouseClick(int button, int state, int x, int y);
		void handleMouseMove(int x, int y);
		void setOverlayScene(std::string name);
		void clearOverlayScene();
		void changeScene(std::string name);
	};

}